Skip to content

Add Severity filter - #920

Merged
vdvukhzhilov merged 10 commits into
allure-framework:mainfrom
d-braun:feat/awesome-severity-filter
Sep 9, 2026
Merged

Add Severity filter#920
vdvukhzhilov merged 10 commits into
allure-framework:mainfrom
d-braun:feat/awesome-severity-filter

Conversation

@d-braun

@d-braun d-braun commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Context

Fixes #921

The awesome report could be narrowed down by transition, tags and categories, but not by severity — even though the severity label is already shown on every test result. This adds a severity dropdown next to the existing quick filters.

  • The dropdown is always visible and offers all five severity levels plus a separate No severity option, so test results that carry no severity label can be filtered for explicitly.
  • Selecting several levels combines them with OR, and the selection is kept in the severity url param, in line with the transition filter.
  • To make this work, the generator now writes the value of the severity label to each tree leaf, falling back to the new noSeverityValue ("none") sentinel from core-api when the label is absent.
  • All 21 locales already had filters.severity and the severity.* level names, so only the new severity.none entry had to be translated.

While covering the new filter, the same code path turned out to be broken for transitions: the transition filter rebuilt from the url put logicalOperator inside the field instead of on the field filter itself, so buildFieldFilters fell back to AND and chained the selected transitions with it. Since a test result has exactly one transition, selecting more than one transition matched nothing at all. That is fixed in a separate commit, with a regression test.

Bildschirmfoto 2026-09-02 um 16 14 03

Checklist

Adds a severity dropdown next to the existing quick filters, so test
results can be narrowed down to one or more severity levels. Test
results without a `severity` label are selectable as their own option
("no severity"), backed by the `none` sentinel value written to the
tree leaves.

The filter is always visible and its state is kept in the `severity`
url param, in line with the transition filter.
The transition filter rebuilt from the url put `logicalOperator` inside
the field instead of on the field filter itself, so `buildFieldFilters`
fell back to "AND" and chained the selected transitions with it. Since a
test result has exactly one transition, selecting more than one
transition matched nothing at all.
@d-braun
d-braun force-pushed the feat/awesome-severity-filter branch from 02b35ec to 0f976f2 Compare September 2, 2026 14:32
@d-braun d-braun changed the title Add a severity filter to the awesome report Add a severity filter to the awesome report (fixes #921) Sep 2, 2026
@vdvukhzhilov
vdvukhzhilov self-requested a review September 7, 2026 15:37

@vdvukhzhilov vdvukhzhilov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! 🙇

Before we can merge this, could you please:

  • Update the branch and resolve any conflicts with latest changes in main
  • Rework the handling of tests without an assigned severity

My concern is the introduced noSeverityValue. By default, most test results do not have an assigned severity, so this implementation would write severity: "none" to almost every generated tree leaf.
Since tree data is serialized into report files, this adds unnecessary data, potentially across multiple generated trees, to represent information already expressed by the absence of the optional severity property.

Please keep severity absent when no severity label is assigned, and adjust the filtering implementation so that "No severity" can select leaves where the property is missing, without introducing or serializing a sentinel value such as noSeverityValue.

Thanks again for working on this! 👍

Tree leaves of test results without a severity label no longer carry a
"none" placeholder, so nothing extra is serialized into the report files.
The "no severity" filter option is translated into a null field filter
instead, which matches leaves where the property is absent.
@d-braun

d-braun commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@vdvukhzhilov Thanks, good catch! The sentinel is gone.

severity is now only written when a severity label is assigned, so leaves without
one don't carry the property at all and noSeverityValue is removed from core-api.

"No severity" now matches the absence of the property: web-commons got a generic
NullField filter type that builds the AQL condition key = null (existing AQL
comparison already treats null and missing alike), and the tree filter store
translates the option into it when building the predicate. "none" only remains as
the UI/URL option key (?severity=none) and never reaches the report files.

Tests updated accordingly.

…-filter

# Conflicts:
#	packages/web-awesome/src/components/ReportFilters/index.tsx
#	packages/web-awesome/src/stores/treeFilters/constants.ts
#	packages/web-awesome/src/stores/treeFilters/utils.ts
#	packages/web-awesome/test/components/ReportFilters.test.tsx
#	packages/web-awesome/test/stores/treeFilters/store.test.ts
#	packages/web-awesome/test/stores/treeFilters/utils.test.ts

@vdvukhzhilov vdvukhzhilov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update 👍

Verified locally:

  • Severity filter is available with all levels + No severity
  • Filtering updates the tree and the severity URL param as expected
  • Multi-select works as OR
  • Leaves only get a severity field when a label is set

LGTM 🎉

@vdvukhzhilov vdvukhzhilov changed the title Add a severity filter to the awesome report (fixes #921) Add Severity filter Sep 9, 2026
@vdvukhzhilov
vdvukhzhilov merged commit 7162f3e into allure-framework:main Sep 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter test results by severity in the awesome report

2 participants